package com.example.cvte.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 郝文雪
 * @date 2022/10/31 23:49
 * @Description 系统配置文件类
 */
@Configuration
public class ApplicationConfig implements WebMvcConfigurer{
    @Autowired
    private UserLoginIntercept userLoginIntercept;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userLoginIntercept).
                addPathPatterns("/user/**").
                excludePathPatterns("/index.html").
                excludePathPatterns("/css/*").
                excludePathPatterns("/js/*").
                excludePathPatterns("/WEB-INF/*").
                excludePathPatterns("/user/login").
                excludePathPatterns("/user/reg").
                excludePathPatterns("/user/verifyCode");

    }
}
